const enventors=[
    {frist:'Alert',last:'enisrein',year:1879},
    {frist:'isaac',last:'newton',year:1643},
    {frist:'calileo',last:'calilei',year:1564},
    {frist:'marie',last:'curie',year:1867},
    {frist:'Johannes',last:'Lakper',year:1571},
    {frist:'nicolaus',last:'copernicus',year:1571},
    {frist:'max',last:'planck',year:1473}
];
function * loop(arr){  // Generator
    for(const item of arr){
        yield item;
    }
}
const inventorGen=loop(enventors);
function * a(arr){
    for(let value of arr){
        yield value;
    }
}
let fen=a(enventors);

for(let res=fen.next();!res.done;res=fen.next()){
    console.log(res.value);
}